package com.cmxh.mycloudnotes.mapper;

import com.cmxh.mycloudnotes.pojo.Category;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
* @author Administrator
* @description 针对表【category】的数据库操作Mapper
* @createDate 2025-03-12 20:14:05
* @Entity com.cmxh.mycloudnotes.pojo.Category
*/
public interface CategoryMapper {

    @Select( "select * from category where create_user = #{id} and zt=0" )
    List<Category> findAll(Integer id);

    @Update(" update category set zt=1 where id = #{id}")
    int updateZt(int id);

    @Insert("insert into category(category_name,category_alias,create_user) values(#{categoryName},#{categoryAlias},#{createUser})")
    int save(Category category);

    @Update("update category set category_name=#{categoryName} , category_alias=#{categoryAlias} where id=#{id}")
    int bianji( Category category);

}
